#!/bin/bash
# 后台运行 redis 和 mariadb
redis-server /etc/redis.conf &
mysqld_safe >> /var/log/maria.log 2>&1 &

# 前台运行 django, 日志输出至 /server.log
# 数据库迁移
python3 /mysite/manage makemigrations
python3 /mysite/manage migrate
python3 /mysite/manage.py runserver 0.0.0.0:80 >> /var/log/server.log 2>&1

# 废弃死循环
# while [[true]] do
# echo "a" >> /dev/null
# done